package com.aruio.excel;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
import com.aruio.domain.Sex;

import java.util.Objects;

/**
 * @Description excel sex converter
 * @Date 2024/9/6 15:31
 * @Created by 10574
 */
public class SexConverter implements Converter<Integer> {
    @Override
    public WriteCellData<?> convertToExcelData(Integer value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
        final String sex = Sex.valueOfCode(value);
        return new WriteCellData<>(sex);
    }
}
